﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using BUS;
using DTO;

public partial class Template : System.Web.UI.MasterPage
{
    
    protected void Page_Load(object sender, EventArgs e)
    {
        List<LoaiSanPhamDto> danhsach = LoaiSanPhamBus.LayDanhSachLoaiSanPham();
        NguoiDungDto nguoidung = (NguoiDungDto)Session["user"];

        if (nguoidung == null || nguoidung.LoaiNguoiDung == 2)
        {
            DataLoaiSanPham.DataSource = danhsach;
            DataLoaiSanPham.DataBind();
        }
        else
        {
            DataLoaiSanPham.Visible = false;
        }
        
       
    }


    protected void btnSearch_Click(object sender, EventArgs e)
    {
        String keyword = txtSearch.Text;
        String path = ResolveClientUrl("~/KetQuaTimKiemSanPham.aspx");
        Response.Redirect(path+"?keyword=" + keyword + "&currentPage=1");
    }
}
